package com.edu.exam.enums.examination.paper;

/**
 * 处理算法枚举
 *
 * 从SegmentationTask实体类中提取的独立枚举
 *
 * @author System
 * @version 1.0.0
 */
public enum ProcessingAlgorithm {
    TEMPLATE_MATCHING("模板匹配"),
    BOUNDARY_DETECTION("边界检测"),
    CONTOUR_ANALYSIS("轮廓分析"),
    DEEP_LEARNING("深度学习"),
    HYBRID("混合算法"),
    NEURAL_NETWORK("神经网络"),
    CONVOLUTIONAL("卷积神经网络"),
    FEATURE_EXTRACTION("特征提取"),
    MACHINE_LEARNING("机器学习"),
    STATISTICAL("统计方法"),
    RULE_BASED("基于规则"),
    HEURISTIC("启发式"),
    BAYESIAN("贝叶斯"),
    SVM("支持向量机"),
    RANDOM_FOREST("随机森林"),
    GRADIENT_BOOSTING("梯度提升"),
    ADABOOST("自适应增强"),
    ENSEMBLE("集成学习"),
    REINFORCEMENT("强化学习"),
    TRANSFER_LEARNING("迁移学习"),
    AUTOENCODER("自动编码器"),
    GENERATIVE("生成模型"),
    DISCRIMINATOR("判别器"),
    CLUSTERING("聚类算法"),
    DIMENSIONALITY_REDUCTION("降维算法"),
    WATERSHED("分水岭算法"),
    REGION_GROWING("区域生长算法"),
    SPLIT_AND_MERGE("分裂合并算法"),
    GRAPH_CUT("图割算法"),
    ACTIVE_CONTOUR("活动轮廓算法"),
    LEVEL_SET("水平集算法"),
    MORPHOLOGICAL("形态学算法"),
    THRESHOLDING("阈值算法"),
    EDGE_BASED("基于边缘的算法"),
    REGION_BASED("基于区域的算法"),
    CLUSTER_BASED("基于聚类的算法"),
    HYBRID_SEGMENTATION("混合分割算法"),
    ADAPTIVE_THRESHOLD("自适应阈值"),
    OTSU_THRESHOLD("大津阈值"),
    MULTI_THRESHOLD("多阈值"),
    COLOR_BASED("基于颜色的算法"),
    TEXTURE_BASED("基于纹理的算法"),
    MOTION_BASED("基于运动的算法"),
    DEPTH_BASED("基于深度的算法"),
    TEMPORAL("时序算法"),
    SPATIAL("空间算法"),
    SPATIO_TEMPORAL("时空算法");

    private final String description;

    ProcessingAlgorithm(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 从描述创建枚举实例
     *
     * @param description 枚举描述
     * @return 对应的枚举实例
     * @throws IllegalArgumentException 如果描述无效
     */
    public static ProcessingAlgorithm fromDescription(String description) {
        for (ProcessingAlgorithm algorithm : values()) {
            if (algorithm.getDescription().equals(description)) {
                return algorithm;
            }
        }
        throw new IllegalArgumentException("Unknown processing algorithm description: " + description);
    }

    @Override
    public String toString() {
        return description;
    }
}